package city.spring.modules.health.service;

import city.spring.modules.health.entity.PhysicalExaminationEntity;
import city.spring.modules.health.vo.PhysicalExaminationVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import lombok.NonNull;
import org.apache.ibatis.annotations.Param;

import java.security.Principal;
import java.util.List;

/**
 * Service：体检记录
 *
 * @author 谢金婷
 * @date 2020-08-04 14:15:52
 */
public interface PhysicalExaminationService extends IService<PhysicalExaminationEntity> {
    String CACHE_NAME = "physical_examination";

    /**
     * 业务处理：保存一个 <strong>体检记录</strong>
     *
     * @param entity 体检记录
     */
    void savePhysicalExamination(PhysicalExaminationEntity entity, @NonNull Principal user);

    /**
     * 业务处理：修改一个 <strong>体检记录</strong>
     *
     * @param entity 体检记录
     */
    void updatePhysicalExamination(PhysicalExaminationEntity entity, @NonNull Principal user);

    /**
     * 业务处理：删除一个 <strong>体检记录</strong>
     *
     * @param primaryKey 主键ID
     */
    void deletePhysicalExamination(String primaryKey);

    /**
     * 业务处理：删除多个 <strong>体检记录</strong>
     *
     * @param primaryKeys 主键ID列表
     */
    void deletePhysicalExamination(List<String> primaryKeys);

    PhysicalExaminationEntity getById(String id);

    /**
     * 分页获取体检记录
     *
     * @param page    分页对象
     * @param wrapper 查询对象
     * @return 老人的外出记录
     */
    IPage<PhysicalExaminationVO> listPage(Page<? extends PhysicalExaminationEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends PhysicalExaminationEntity> wrapper);
}